{% extends "base.html" %}
{% block head %}
    {{ super() }}
    {% assets "css_home" %}
    <link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css" />
    {% endassets %}
{% endblock %}

{% block body_left %}
    {{ super() }}
{% endblock %}

{% block body_right %}
    <div class="center_container">
        <div class="blog_container">
            {% for blog in blogs %}
            <div class="blog_layout">
                <div class="blog_content">
                    <a href="/blog/{{ blog._id }}"><h3>{{ blog.title }}</h3></a>
                    <div class="tags_layout">
                        <span class="span_cate">{{ blog.category }}</span>
                        {% for tag in blog.tags %}
                        <span class="span_tag">{{ tag }}</span>
                        {% endfor %}
                        {% if current_user.is_authenticated() %}
                        <div class="blog_admin">
                            <!--<span class="span_tag">{{ current_user.id }}</span>-->
                            <a href="/admin/edit/{{ blog._id }}" >编辑</a>
                            <button bid="{{ blog._id }}" onclick="base.delete_blog(this)">删除</button>
                        </div>
                        {% endif %}
                    </div>
                    <blockquote><p>{{ blog.brief }}</p></blockquote>
                    <span class="span_normal">Write:{{ blog.pub_date.strftime("%Y-%m-%d %H:%M") }}</span>
                    <span class="span_normal">Modify:{{ blog.mod_date.strftime("%Y-%m-%d %H:%M") }}</span>
                    <span class="span_normal">{{ blog.read_count }}次围观</span>
                    <span class="span_normal">{{ blog.comments_count }}次讨论</span>
                    <span class="span_normal" style="display: none;" id="span_love" bid="{{blog._id}}" onclick="base.love(this)">{{ blog.love_count }}次点赞</span>
                </div>
                <div class="blog_spacer"></div>
            </div>
            {% endfor %}
        </div>
    </div>
{% endblock %}
